﻿<Window x:Class="Wpfконфигуратор.СоздатьОбъект"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Создать Объект" 
        ShowInTaskbar="True"
        MaxHeight="700"
        SizeToContent="WidthAndHeight" WindowStyle="ToolWindow"
        DataContextChanged="Окно_DataContextChanged" Background="#FFF9F9F9" >
    <Window.Resources>
        <Style TargetType="Button" >
            <Setter Property="Margin" Value="5"/>
        </Style>
        
        <Style TargetType="TextBlock" >
            <Setter Property="Margin" Value="5"/>
        </Style>
    </Window.Resources>
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto"/>
            <RowDefinition  Height="Auto"/>
            <RowDefinition  Height="Auto"/>
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        
        <TextBlock Name="TextBlockЗаголовокПеременная" Grid.Column="0" Grid.Row="0" Text="Тип Переменной:"  HorizontalAlignment="Right" Foreground="Silver" />
        <TextBlock Name="TextBlockПеременная" Grid.Column="1" Grid.Row="0" Text="{Binding Path=Переменная.ТипПеременной.Имя}" MinWidth="200"
                   ToolTip="{Binding Path=ТипПеременной.Описание}" HorizontalAlignment="Left" Background="White" />
        
        <TextBlock Grid.Column="0" Grid.Row="1" Text="Тип Объекта:" Margin="5" HorizontalAlignment="Right" Foreground="Silver" />

        <StackPanel Orientation="Horizontal" Grid.Column="1" Grid.Row="1" HorizontalAlignment="Left" >
            <TextBlock  Text="{Binding Path=ВыбранныйТип.ОписаниеТипа.Имя}" MinWidth="200" Background="White" />
            <Button Name="КнопкаСоздать" Content="Выбрать" VerticalAlignment="Center" Click="КнопкаСоздать_Click" />
        </StackPanel>
        
        <TextBlock Grid.Column="0" Grid.Row="2" Text="Конструкторы:" HorizontalAlignment="Right" Foreground="Silver" />
        <StackPanel Orientation="Vertical"  Grid.Column="1" Grid.Row="2" HorizontalAlignment="Left" Margin="5">
            <ListBox  Name="Конструкторы" MinHeight="20" ItemsSource="{Binding Path=Конструкторы}" 
                      SelectedItem="{Binding Path=Конструктор}"  />
        	<TextBlock Text="{Binding Path=Конструктор}"  />
        </StackPanel>
        
        <StackPanel  Grid.Column="1" Grid.Row="3" Orientation="Horizontal" HorizontalAlignment="Right" Margin="5" >
            <Button Content="Создать" Click="Button_Click" />
            <Button Content="Отмена" IsCancel="True" />
        </StackPanel>

    </Grid>
</Window>
